<?php
namespace Admin\Controller;
use Admin\Controller\AdminController;
class ViewController extends AdminController {
	public function index(){
		$row = M('View')->find();
		$this -> assign('row',$row);
		$this -> display();
	}
	public function add(){
		$content = $_POST['content'];
		M('View')->where(array('id'=>1))->setField('view',$content);
		$re = $this -> wechat ->createview($content);
		if($re['errmsg'] != 'ok'){
			$this -> error($re['errmsg']);
		}
		$this -> success('修改成功');
		
	}
}